import datetime
from dateutil.relativedelta import relativedelta
if __name__ == "__main__":
    startStr = '20150901'
    for i in range(1,29):
     startDate = datetime.datetime.strptime(startStr, '%Y%m%d')
     endDate=startDate + relativedelta(months=+1)
     endStr= endDate.strftime('%Y%m%d')
     print startStr+"-"+endStr
     startStr=endStr
